import java.io.FileReader;
import java.util.Scanner;

public class FileHandler {
	private static final int MAX_PROGRAM_SIZE = 50;
	private FileReader fReader;
	private Scanner scanner;
	private String line;
	private String[] nonComments = new String[MAX_PROGRAM_SIZE];
	private int nonCommentsPosition, lineNumber;
	private boolean withinComment = false;

	FileHandler(FileReader fileReader) {
		fReader = fileReader;
		scanner = new Scanner(fReader);
	}

	public void readLines() {
		while (scanner.hasNextLine()) {
			line = scanner.nextLine();

			// code
			if (!line.startsWith("/*") && !withinComment
					&& !line.startsWith("//")) {
				nonComments[nonCommentsPosition] = line;
				nonCommentsPosition++;
				parseLine(line);
			}
			
			
			// comment
			else if (line.endsWith("*/")) {
				withinComment = false;
				System.out.println("COMMENT LINE: " + line);
			} else {
				System.out.println("COMMENT LINE: " + line);
			}
			lineNumber++;
		}
	}

	private void parseLine(String l) {
		System.out.println("PARSING LINE " + lineNumber);
	}

	public String[] getNonComments() {
		return nonComments;
	}

}
